import type { ISMap } from '@/compnents/map-kit';
import type { SuggestionOptions, SuggestionProps } from '@tiptap/suggestion';

export type IMaterialRecord = {
  key: string;
  content: string;
  keywords: string;
  desc?: string;
  icon: React.ReactNode;
  isActive: boolean;
  className: string;
  render?: (node: React.ReactNode) => React.ReactNode;
};

export type IMaterialRef = Pick<Required<ReturnType<NonNullable<SuggestionOptions<IMaterialRecord>['render']>>>, 'onKeyDown'>;
export type IMaterialProps = SuggestionProps<IMaterialRecord> & {
  map: ISMap;
};

export type IRegisterProps = {
  componentProps: Pick<IMaterialProps, 'map'>;
};
